package org.aplikator.client.descriptor;

import org.aplikator.client.widgets.FormWidget;
import org.aplikator.client.widgets.TextAreaWidget;

import com.google.gwt.user.client.ui.Widget;

@SuppressWarnings("serial")
public class TextAreaDTO implements WidgetDTO {

    private PropertyDTO<String> property;

    private boolean labelAbove = false;

    private String width;

    private String height;

    @SuppressWarnings("unused")
    private TextAreaDTO() {
    }

    public TextAreaDTO(PropertyDTO<String> property) {
        this.property = property;
    }

    public Widget getWidget(FormWidget form) {
        TextAreaWidget field = new TextAreaWidget(property.getLocalizedName(), property, labelAbove, width, height);
        form.registerDataField(field);
        return field;
    }

    public boolean isLabelAbove() {
        return labelAbove;
    }

    public void setLabelAbove(boolean labelAbove) {
        this.labelAbove = labelAbove;
    }

    public void setWidth(String width) {
        this.width = width;
    }

    public String getWidth() {
        return width;
    }

    public void setHeight(String height) {
        this.height = height;
    }

    public String getHeight() {
        return height;
    }

}
